package cn.sylinx.hbatis.ext.xmapper.plugin;

import cn.sylinx.hbatis.ext.xmapper.xml.XmlSqlMapper;
import cn.sylinx.hbatis.plugin.IPlugin;

public class XmapperPlugin implements IPlugin {
	
	private String resourcePath;
	
	public XmapperPlugin() {
	}
	
	public XmapperPlugin(String resourcePath) {
		this.resourcePath = resourcePath;
	}
	
	public void setResourcePath(String resourcePath) {
		this.resourcePath = resourcePath;
	}
	
	@Override
	public boolean start(Object... objects) {
		return XmlSqlMapper.get().load(resourcePath);
	}
	
	@Override
	public boolean stop() {
		XmlSqlMapper.get().clear();
		return true;
	}
	
}
